Add the Stage 5 Cloud Run Simulation Entry service#651
Draft
anth-volk wants to merge 13 commits into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #650
Summary
policyengine-simulation-entryFastAPIservice on Cloud Run while retaining the existing Modal gateway and executor;
through unchanged;
authentication to Modal;
TypedDictschemas shared by the entrypoint, gateway, executor, OpenAPI, andgenerated client;
executor in three parallel jobs for each environment;
integration tests followed by a separate authenticated test job;
a beta custom domain;
Run revision only after the complete production suite passes;
exact previous revision if immediate post-promotion checks fail; and
committed bootstrap automation.
Why
Stage 5 establishes the permanent simulation control-plane boundary before
later stages migrate routing, durable state, and worker responsibilities. The
existing Modal gateway remains the authenticated backend and rollback target.
The entrypoint does not need its own URL as runtime configuration. Cloud Run
provides tagged candidate and stable service URLs, and the existing
.modal.runupstream restriction prevents recursive configuration. The service returns its
Cloud Run revision in a response header so deployment checks can prove which
exact revision a URL serves.
Deployment safety
The production promotion job records the currently serving revision before
deployment. Before changing traffic it verifies that:
Promotion and rollback always name exact revisions; they never use
LATEST.Repository-level deployment concurrency prevents overlapping releases.
This automation changes only the Simulation Entrypoint Cloud Run service's
traffic. It does not change API v1 revision percentages or activate API v1's
entrypoint migration flag.
Validation
shared contract, and observability packages.
rollback, and refusal to overwrite an intervening traffic change.
git diff --checkpass.Live integration and authentication tests require deployed candidate URLs and
protected environment configuration and remain explicit deployment jobs.